<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <title>乐淘商城-购物车</title>
  <link rel="icon" href="favicon.ico" type="image/x-icon">
  <link rel="stylesheet" href="lib/mui/css/mui.css">
  <link rel="stylesheet" href="lib/fa/css/font-awesome.css">
  <link rel="stylesheet" href="css/common.css">
  <link rel="stylesheet" href="css/cart.css">

</head>
<body>

<div class="lt_container">
  
  <div class="lt_header">
    <a class="icon_left" href="javascript:history.go(-1);"><span class="mui-icon mui-icon-arrowleft"></span></a>
    <h4>购物车</h4>
  </div>

  <div class="lt_main">
    <div class="mui-scroll-wrapper">
      <div class="mui-scroll">

        <ul class="mui-table-view">
          <!--挖个坑-->
        </ul>

      </div>
    </div>
  </div>

  <div class="lt_total">
    <div class="mui-pull-left">订单总金额 &yen;<span class="total">00.00</span></div>
    <a href="javascript:;" class="mui-pull-right btn_order">生成订单</a>
  </div>

  <div class="lt_footer">
    <ul class="mui-clearfix">
      <li>
        <a href="index.html">
          <span class="fa fa-home"></span>
          <p>首页</p>
        </a>
      </li>
      <li>
        <a href="category.html">
          <span class="fa fa-bars"></span>
          <p>分类</p>
        </a>
      </li>
      <li class="now">
        <a href="cart.html">
          <span class="fa fa-shopping-cart"></span>
          <p>购物车</p>
        </a>
      </li>
      <li>
        <a href="user.html">
          <span class="fa fa-user"></span>
          <p>会员中心</p>
        </a>
      </li>
    </ul>
  </div>
</div>

<script type="text/html" id="tpl">
  {{if list.length === 0}}
  <p>购物车没有商品，快去剁手吧，，，</p>
  {{/if}}

  {{each list v i}}
  <li class="mui-table-view-cell mui-transitioning">
    <div class="mui-slider-right mui-disabled">
      <a class="mui-btn mui-btn-blue mui-icon mui-icon-compose btn_edit"
         data-id="{{v.id}}"
         data-num="{{v.num}}"
         data-productNum="{{v.productNum}}"
         data-size="{{v.size}}"
         data-productSize="{{v.productSize}}"
      ></a>
      <a data-id="{{v.id}}" class="mui-btn mui-btn-red mui-icon mui-icon-trash btn_delete"></a>
    </div>
    <div class="mui-slider-handle">
      <div class="mui-table-cell">
        <input type="checkbox" class="ck"
              data-price="{{v.price}}"
              data-num="{{v.num}}"
        >
        <div class="mui-pull-left img_box">
          <img src="{{v.pic[0].picAddr}}" alt="">
        </div>

        <div class="info_box">
          <p class="proName mui-ellipsis-2">{{v.proName}}</p>
          <p>
            <span class="price">&yen;{{v.price}}</span>
            <span class="oldPrice">&yen;{{v.oldPrice}}</span>
            <span class="num">{{v.num}}双</span>
          </p>
          <p class="size">鞋码：{{v.size}}</p>
        </div>
      </div>
    </div>
  </li>
  {{/each}}
</script>

<script type="text/html" id="tpl2">
  <div class="lt_edit_size">
    <strong>尺码：</strong>

    <%
      var temp = productsize.split("-");
      for(var i = temp[0]; i <= temp[1]; i++){
    %>
    <span class="{{i==size?'now':''}}">{{i}}</span>
    <% } %>

  </div>

  <div class="lt_edit_num">
    <strong>数量：</strong>
    <div class="mui-numbox" data-numbox-step='1' data-numbox-min='1' data-numbox-max='{{productnum}}'>
      <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
      <input class="mui-numbox-input" type="number" value="{{num}}"/>
      <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
    </div>
  </div>
</script>


<!--模块化：requirejs    webpack-->
<script src="lib/mui/js/mui.js"></script>
<script src="lib/zepto/zepto.min.js"></script>
<script src="lib/artTemplate/template-web.js"></script>
<script src="js/common.js"></script>
<script src="js/cart.js"></script>
</body>
</html>